<?php

Yii::import('ext.googleapi.lib.Google_Client', true);
Yii::import('ext.googleapi.lib.contrib.Google_CalendarService', true);
//session_start();

$client = new Google_Client();
$client->setApplicationName("Google Calendar PHP Starter Application");

// Visit https://code.google.com/apis/console?api=calendar to generate your
// client id, client secret, and to register your redirect uri.
$client->setClientId('848332076147.apps.googleusercontent.com');
$client->setClientSecret('CWmBOLwwdAOvDn3uiY_jgqG3');
$client->setRedirectUri('http://voithan.com/demo/Webmaster/test/t');
// $client->setDeveloperKey('insert_your_developer_key');
$cal = new Google_CalendarService($client);

$client->setAccessToken('{"access_token":"ya29.1.AADtN_WxqB1N_Tx5msrS63CEuCHXA0HMMUzCHVxK-RWolpBJJ2xmRoTxByr5mio_8Q","token_type":"Bearer","expires_in":3600,"refresh_token":"1\/UtogSqfm7XjSmaWRPYwjmCio1duUL0jBz1XVcGcPyac","created":1385642579}');


$calList = $cal->calendarList->listCalendarList();
print "<h1>Calendar List</h1><pre>" . print_r($calList, true) . "</pre>";

//$user=  UserOAuth::model()->find('user_id=117');
//echo $user->session_data;




